package cn.com.biz;

import java.util.List;

import cn.com.dao.DepartmentsDao;
import cn.com.entity.Departments;

public class DepartmentsBiz {
	//科室biz文件
	private DepartmentsDao departmentsdao;
	public DepartmentsDao getDepartmentsdao() {
		return departmentsdao;
	}
	public void setDepartmentsdao(DepartmentsDao departmentsdao) {
		this.departmentsdao = departmentsdao;
	}
	//查询所有科室
	public List<Departments> selectAlldeDepartments(){
		List<Departments> list=departmentsdao.selectAlldeDepartments();
		return list;
	}
	//查询一个科室
	public Departments selectOneDepartments(Departments departments){
		Departments depart=departmentsdao.selectOneDepartments(departments);
		return depart;
	}

	//通过传入的科室值判断
	public List<Departments> selectDepartments(Departments departments){
		if(departments==null){
			departments.setDepartmentsid(0);
		}
		List<Departments> list=departmentsdao.selectDepartments(departments);
		return list;
	}
	
	
	
	//添加科室
	public boolean addDepartments(Departments departments){
		boolean bool=departmentsdao.addDepartments(departments);
		return bool;
	}
	//更新科室
	public boolean updateDepartments(Departments departments){
		boolean bool=departmentsdao.updateDepartments(departments);
				return bool;
	}
	//删除科室
	public boolean deleteDepartments(Departments departments){
		boolean bool=departmentsdao.deleteDepartments(departments);
		return bool;
	}
	
}
